// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Author: wsfuyibing <682805@qq.com>
// Date: 2024-12-02

package cluster

import (
	"gitee.com/go-wares/framework-iris/framework/src/logics"
	"github.com/kataras/iris/v12"
	"gomq/app/logics/cluster/detail"
	"gomq/app/logics/cluster/disable"
	"gomq/app/logics/cluster/edit"
	"gomq/app/logics/cluster/enable"
	"gomq/app/logics/cluster/list"
)

// Controller Cluster operations.
//
// @RoutePrefix("/api/cluster")
type Controller struct {
}

func (o *Controller) GetDetail(i iris.Context) {
	logics.Do(i, detail.New)
}

func (o *Controller) GetList(i iris.Context) {
	logics.Do(i, list.New)
}

// PostDisable disable a cluster.
func (o *Controller) PostDisable(i iris.Context) {
	logics.Do(i, disable.New)
}

// PostEdit edit a subscription task.
func (o *Controller) PostEdit(i iris.Context) {
	logics.Do(i, edit.New)
}

// PostEnable enable a cluster.
func (o *Controller) PostEnable(i iris.Context) {
	logics.Do(i, enable.New)
}
